3.7.8 \(\int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^2 \, dx\) [608]
Optimal. Leaf size=193 \[ \frac {d (d-2 c (2+m)) \cos (e+f x) (a+a \sin (e+f x))^m}{f (1+m) (2+m)}-\frac {2^{\frac {1}{2}+m} \left (2 c d m (2+m)+d^2 \left (1+m+m^2\right )+c^2 \left (2+3 m+m^2\right )\right ) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1}{2}-m;\frac {3}{2};\frac {1}{2} (1-\sin (e+f x))\right ) (1+\sin (e+f x))^{-\frac {1}{2}-m} (a+a \sin (e+f x))^m}{f (1+m) (2+m)}-\frac {d^2 \cos (e+f x) (a+a \sin (e+f x))^{1+m}}{a f (2+m)} \]
[Out]
d*(d-2*c*(2+m))*cos(f*x+e)*(a+a*sin(f*x+e))^m/f/(1+m)/(2+m)-2^(1/2+m)*(2*c*d*m*(2+m)+d^2*(m^2+m+1)+c^2*(m^2+3*
m+2))*cos(f*x+e)*hypergeom([1/2, 1/2-m],[3/2],1/2-1/2*sin(f*x+e))*(1+sin(f*x+e))^(-1/2-m)*(a+a*sin(f*x+e))^m/f
/(m^2+3*m+2)-d^2*cos(f*x+e)*(a+a*sin(f*x+e))^(1+m)/a/f/(2+m)
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 193, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {2840, 2830,
2731, 2730} \begin {gather*} -\frac {2^{m+\frac {1}{2}} \left (c^2 \left (m^2+3 m+2\right )+2 c d m (m+2)+d^2 \left (m^2+m+1\right )\right ) \cos (e+f x) (\sin (e+f x)+1)^{-m-\frac {1}{2}} (a \sin (e+f x)+a)^m \, _2F_1\left (\frac {1}{2},\frac {1}{2}-m;\frac {3}{2};\frac {1}{2} (1-\sin (e+f x))\right )}{f (m+1) (m+2)}+\frac {d (d-2 c (m+2)) \cos (e+f x) (a \sin (e+f x)+a)^m}{f (m+1) (m+2)}-\frac {d^2 \cos (e+f x) (a \sin (e+f x)+a)^{m+1}}{a f (m+2)} \end {gather*}
Antiderivative was successfully verified.
[In]
Int[(a + a*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^2,x]
[Out]
(d*(d - 2*c*(2 + m))*Cos[e + f*x]*(a + a*Sin[e + f*x])^m)/(f*(1 + m)*(2 + m)) - (2^(1/2 + m)*(2*c*d*m*(2 + m)
+ d^2*(1 + m + m^2) + c^2*(2 + 3*m + m^2))*Cos[e + f*x]*Hypergeometric2F1[1/2, 1/2 - m, 3/2, (1 - Sin[e + f*x]
)/2]*(1 + Sin[e + f*x])^(-1/2 - m)*(a + a*Sin[e + f*x])^m)/(f*(1 + m)*(2 + m)) - (d^2*Cos[e + f*x]*(a + a*Sin[
e + f*x])^(1 + m))/(a*f*(2 + m))
Rule 2730
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-2^(n + 1/2))*a^(n - 1/2)*b*(Cos[c + d*x]/
(d*Sqrt[a + b*Sin[c + d*x]]))*Hypergeometric2F1[1/2, 1/2 - n, 3/2, (1/2)*(1 - b*(Sin[c + d*x]/a))], x] /; Free
Q[{a, b, c, d, n}, x] && EqQ[a^2 - b^2, 0] && !IntegerQ[2*n] && GtQ[a, 0]
Rule 2731
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[a^IntPart[n]*((a + b*Sin[c + d*x])^FracPart
[n]/(1 + (b/a)*Sin[c + d*x])^FracPart[n]), Int[(1 + (b/a)*Sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, n}, x]
&& EqQ[a^2 - b^2, 0] && !IntegerQ[2*n] && !GtQ[a, 0]
Rule 2830
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d
)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/(f*(m + 1))), x] + Dist[(a*d*m + b*c*(m + 1))/(b*(m + 1)), Int[(a + b*S
in[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && !LtQ[m
, -2^(-1)]
Rule 2840
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[(-
d^2)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(b*(m + 2)), Int[(a + b*Sin[e + f*
x])^m*Simp[b*(d^2*(m + 1) + c^2*(m + 2)) - d*(a*d - 2*b*c*(m + 2))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c,
d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && !LtQ[m, -1]
Rubi steps
\begin {align*} \int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^2 \, dx &=-\frac {d^2 \cos (e+f x) (a+a \sin (e+f x))^{1+m}}{a f (2+m)}+\frac {\int (a+a \sin (e+f x))^m \left (a \left (d^2 (1+m)+c^2 (2+m)\right )-a d (d-2 c (2+m)) \sin (e+f x)\right ) \, dx}{a (2+m)}\\ &=\frac {d (d-2 c (2+m)) \cos (e+f x) (a+a \sin (e+f x))^m}{f (1+m) (2+m)}-\frac {d^2 \cos (e+f x) (a+a \sin (e+f x))^{1+m}}{a f (2+m)}+\frac {\left (2 c d m (2+m)+d^2 \left (1+m+m^2\right )+c^2 \left (2+3 m+m^2\right )\right ) \int (a+a \sin (e+f x))^m \, dx}{(1+m) (2+m)}\\ &=\frac {d (d-2 c (2+m)) \cos (e+f x) (a+a \sin (e+f x))^m}{f (1+m) (2+m)}-\frac {d^2 \cos (e+f x) (a+a \sin (e+f x))^{1+m}}{a f (2+m)}+\frac {\left (\left (2 c d m (2+m)+d^2 \left (1+m+m^2\right )+c^2 \left (2+3 m+m^2\right )\right ) (1+\sin (e+f x))^{-m} (a+a \sin (e+f x))^m\right ) \int (1+\sin (e+f x))^m \, dx}{(1+m) (2+m)}\\ &=\frac {d (d-2 c (2+m)) \cos (e+f x) (a+a \sin (e+f x))^m}{f (1+m) (2+m)}-\frac {2^{\frac {1}{2}+m} \left (2 c d m (2+m)+d^2 \left (1+m+m^2\right )+c^2 \left (2+3 m+m^2\right )\right ) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1}{2}-m;\frac {3}{2};\frac {1}{2} (1-\sin (e+f x))\right ) (1+\sin (e+f x))^{-\frac {1}{2}-m} (a+a \sin (e+f x))^m}{f (1+m) (2+m)}-\frac {d^2 \cos (e+f x) (a+a \sin (e+f x))^{1+m}}{a f (2+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(1774\) vs. \(2(193)=386\).
time = 71.86, size = 1774, normalized size = 9.19 \begin {gather*} \text {Too large to display} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
Integrate[(a + a*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^2,x]
[Out]
(-2*(Cos[(-e + Pi/2 - f*x)/2]^2)^(1/2 - m)*(1 - Sin[(-e + Pi/2 - f*x)/2]^2)^(-1/2 + m)*(c + d - 2*d*Sin[(-e +
Pi/2 - f*x)/2]^2)^2*(4*Gamma[3/2 - m]*HypergeometricPFQ[{3/2, 2, 3/2 - m}, {1, 9/2}, Sin[(-e + Pi/2 - f*x)/2]^
2]*Sin[(-e + Pi/2 - f*x)/2]^2*(c + d - 2*d*Sin[(-e + Pi/2 - f*x)/2]^2)^2 + 16*Gamma[3/2 - m]*Hypergeometric2F1
[3/2, 3/2 - m, 9/2, Sin[(-e + Pi/2 - f*x)/2]^2]*Sin[(-e + Pi/2 - f*x)/2]^2*(c^2 + c*d*(2 - 3*Sin[(-e + Pi/2 -
f*x)/2]^2) + d^2*(1 - 3*Sin[(-e + Pi/2 - f*x)/2]^2 + 2*Sin[(-e + Pi/2 - f*x)/2]^4)) + 7*Gamma[1/2 - m]*Hyperge
ometric2F1[1/2, 1/2 - m, 7/2, Sin[(-e + Pi/2 - f*x)/2]^2]*(15*c^2 + 10*c*d*(3 - 2*Sin[(-e + Pi/2 - f*x)/2]^2)
+ d^2*(15 - 20*Sin[(-e + Pi/2 - f*x)/2]^2 + 12*Sin[(-e + Pi/2 - f*x)/2]^4)))*(a + a*Sin[e + f*x])^m*Tan[(-e +
Pi/2 - f*x)/2])/(f*(4*Gamma[3/2 - m]*HypergeometricPFQ[{3/2, 2, 3/2 - m}, {1, 9/2}, Sin[(-e + Pi/2 - f*x)/2]^2
]*Sin[(-e + Pi/2 - f*x)/2]^2*(c + d - 2*d*Sin[(-e + Pi/2 - f*x)/2]^2)^2 + 16*Gamma[3/2 - m]*Hypergeometric2F1[
3/2, 3/2 - m, 9/2, Sin[(-e + Pi/2 - f*x)/2]^2]*Sin[(-e + Pi/2 - f*x)/2]^2*(c^2 + c*d*(2 - 3*Sin[(-e + Pi/2 - f
*x)/2]^2) + d^2*(1 - 3*Sin[(-e + Pi/2 - f*x)/2]^2 + 2*Sin[(-e + Pi/2 - f*x)/2]^4)) + 7*Gamma[1/2 - m]*Hypergeo
metric2F1[1/2, 1/2 - m, 7/2, Sin[(-e + Pi/2 - f*x)/2]^2]*(15*c^2 + 10*c*d*(3 - 2*Sin[(-e + Pi/2 - f*x)/2]^2) +
d^2*(15 - 20*Sin[(-e + Pi/2 - f*x)/2]^2 + 12*Sin[(-e + Pi/2 - f*x)/2]^4)) + (2*Sin[(-e + Pi/2 - f*x)/2]^2*(-4
8*d*Gamma[3/2 - m]*HypergeometricPFQ[{3/2, 2, 3/2 - m}, {1, 9/2}, Sin[(-e + Pi/2 - f*x)/2]^2]*Sin[(-e + Pi/2 -
f*x)/2]^2*(c + d - 2*d*Sin[(-e + Pi/2 - f*x)/2]^2) + 12*Gamma[3/2 - m]*HypergeometricPFQ[{3/2, 2, 3/2 - m}, {
1, 9/2}, Sin[(-e + Pi/2 - f*x)/2]^2]*(c + d - 2*d*Sin[(-e + Pi/2 - f*x)/2]^2)^2 - 4*(-3 + 2*m)*Gamma[3/2 - m]*
HypergeometricPFQ[{5/2, 3, 5/2 - m}, {2, 11/2}, Sin[(-e + Pi/2 - f*x)/2]^2]*Sin[(-e + Pi/2 - f*x)/2]^2*(c + d
- 2*d*Sin[(-e + Pi/2 - f*x)/2]^2)^2 + 48*d*Gamma[3/2 - m]*Hypergeometric2F1[3/2, 3/2 - m, 9/2, Sin[(-e + Pi/2
- f*x)/2]^2]*Sin[(-e + Pi/2 - f*x)/2]*(-3*c*Sin[(-e + Pi/2 - f*x)/2] + d*Sin[(-e + Pi/2 - f*x)/2]*(-3 + 4*Sin[
(-e + Pi/2 - f*x)/2]^2)) + 84*d*Gamma[1/2 - m]*Hypergeometric2F1[1/2, 1/2 - m, 7/2, Sin[(-e + Pi/2 - f*x)/2]^2
]*(-5*c + d*(-5 + 6*Sin[(-e + Pi/2 - f*x)/2]^2)) + 48*Gamma[3/2 - m]*Hypergeometric2F1[3/2, 3/2 - m, 9/2, Sin[
(-e + Pi/2 - f*x)/2]^2]*(c^2 + c*d*(2 - 3*Sin[(-e + Pi/2 - f*x)/2]^2) + d^2*(1 - 3*Sin[(-e + Pi/2 - f*x)/2]^2
+ 2*Sin[(-e + Pi/2 - f*x)/2]^4)) - 8*(-3 + 2*m)*Gamma[3/2 - m]*Hypergeometric2F1[5/2, 5/2 - m, 11/2, Sin[(-e +
Pi/2 - f*x)/2]^2]*Sin[(-e + Pi/2 - f*x)/2]^2*(c^2 + c*d*(2 - 3*Sin[(-e + Pi/2 - f*x)/2]^2) + d^2*(1 - 3*Sin[(
-e + Pi/2 - f*x)/2]^2 + 2*Sin[(-e + Pi/2 - f*x)/2]^4)) + 3*(1/2 - m)*Gamma[1/2 - m]*Hypergeometric2F1[3/2, 3/2
- m, 9/2, Sin[(-e + Pi/2 - f*x)/2]^2]*(15*c^2 + 10*c*d*(3 - 2*Sin[(-e + Pi/2 - f*x)/2]^2) + d^2*(15 - 20*Sin[
(-e + Pi/2 - f*x)/2]^2 + 12*Sin[(-e + Pi/2 - f*x)/2]^4))))/3))
________________________________________________________________________________________
Maple [F]
time = 0.38, size = 0, normalized size = 0.00 \[\int \left (a +a \sin \left (f x +e \right )\right )^{m} \left (c +d \sin \left (f x +e \right )\right )^{2}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((a+a*sin(f*x+e))^m*(c+d*sin(f*x+e))^2,x)
[Out]
int((a+a*sin(f*x+e))^m*(c+d*sin(f*x+e))^2,x)
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+a*sin(f*x+e))^m*(c+d*sin(f*x+e))^2,x, algorithm="maxima")
[Out]
integrate((d*sin(f*x + e) + c)^2*(a*sin(f*x + e) + a)^m, x)
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+a*sin(f*x+e))^m*(c+d*sin(f*x+e))^2,x, algorithm="fricas")
[Out]
integral(-(d^2*cos(f*x + e)^2 - 2*c*d*sin(f*x + e) - c^2 - d^2)*(a*sin(f*x + e) + a)^m, x)
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a \left (\sin {\left (e + f x \right )} + 1\right )\right )^{m} \left (c + d \sin {\left (e + f x \right )}\right )^{2}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+a*sin(f*x+e))**m*(c+d*sin(f*x+e))**2,x)
[Out]
Integral((a*(sin(e + f*x) + 1))**m*(c + d*sin(e + f*x))**2, x)
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+a*sin(f*x+e))^m*(c+d*sin(f*x+e))^2,x, algorithm="giac")
[Out]
integrate((d*sin(f*x + e) + c)^2*(a*sin(f*x + e) + a)^m, x)
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (a+a\,\sin \left (e+f\,x\right )\right )}^m\,{\left (c+d\,\sin \left (e+f\,x\right )\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((a + a*sin(e + f*x))^m*(c + d*sin(e + f*x))^2,x)
[Out]
int((a + a*sin(e + f*x))^m*(c + d*sin(e + f*x))^2, x)
________________________________________________________________________________________